﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ViewMasterPage1.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<title>Search</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Search</h2>
  <% using (Html.BeginForm())
     {%>
     <%=ViewData["error"]%>
     <p>
            <%if (ViewData["NhaSanXuat"] != null)
              {%>
                <label for="idNSX">Nhà Sản Xuất:</label>
                <%=Html.DropDownList("idNSX", (SelectList)ViewData["NhaSanXuat"])%>
                
            <%} %>
    </p>
    <p>
            <%if (ViewData["NhaPhanPhoi"] != null)
              {%>
                <label for="idNhaPhanPhoi">Nhà Phân Phối:</label>
                <%=Html.DropDownList("idNhaPhanPhoi", (SelectList)ViewData["NhaPhanPhoi"])%>
            <%} %>
    </p>
    <p>
            <%if (ViewData["LoaiSanPham"] != null)
              {%>
                <label for="idLoaiSanPham">Sản Phẩm:</label>
                <%=Html.DropDownList("idLoaiSanPham", (SelectList)ViewData["LoaiSanPham"])%>
            <%} %>
    </p>
    <p>
         <% 
         IEnumerable<String> ieGiaMin =new List<String>{"0","100","500","1000000","2000000","4000000","6000000","8000000","10000000","15000000","20000000","25000000"};
         %>
                <label for="idGiaMin">Giá Thấp Nhất : </label>
                <%=Html.DropDownList("idGiaMin", new SelectList(ieGiaMin))%>    
         <% 
                  IEnumerable<String> ieGiaMax = new List<String> { "100", "500", "1000000", "2000000", "4000000", "6000000", "8000000", "10000000", "15000000", "20000000", "25000000" };
         %>
                <label for="idGiaMax">Giá Cao Nhất : </label>
                <%=Html.DropDownList("idGiaMax", new SelectList(ieGiaMax))%>
           
            
      
           
    </p>
    <p>
        <label for="TenSanPham">Tên Sản Phẩm:</label>
        
        <%= Html.TextBox("TenSanPham")%>
        <%= Html.ValidationMessage("TenSanPham", "*")%>
    </p>
    <p>
        <input type="submit" value="Search" />
    </p>
    <div id="sp-ketqua">
        <%List<ComputerShopE3.Models.SAN_PHAM> lst = (List<ComputerShopE3.Models.SAN_PHAM>)ViewData["KetQua"];
          if (lst != null)
          {
              foreach (var item in lst)
              {%>
              <p>
            
         
        <%=item.TenSanPham%>  <%= Html.ActionLink("Chi tiết", "Details", new { id=item.id })%>
        
        </p>
        <%
      }
        %>
   </div>
   <%}
     } %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="PersonalMenu" runat="server">
</asp:Content>
